﻿Imports Microsoft.Reporting.WinForms

Public Class frmPreview

    Private strReport As String = Nothing
    Private uriReportServer As Uri = Nothing
    Private _WindowsAuthorization As Boolean = True
    Private _Username As String = Nothing
    Private _Password As String = Nothing
    Private _ReportType As String = Nothing

    Public Property Report() As String
        Get
            Return strReport
        End Get
        Set(ByVal value As String)
            strReport = value
        End Set
    End Property

    Public Property ReportServer() As Uri
        Get
            Return uriReportServer
        End Get
        Set(ByVal value As Uri)
            uriReportServer = value
        End Set
    End Property

    Public Property ReportType() As String
        Get
            Return _ReportType
        End Get
        Set(ByVal value As String)
            _ReportType = value
        End Set
    End Property


    Private Sub frmPreview_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Try
            rvReport.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote
            Dim serverReport As ServerReport = rvReport.ServerReport
            serverReport.ReportServerUrl = ReportServer
            serverReport.ReportPath = Report

        Catch ex As Exception
            MessageBox.Show(ex.ToString())
        End Try

        Try
            rvReport.RefreshReport()
        Catch ex As Exception
            MessageBox.Show(ex.ToString())
        End Try
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        DialogResult = Windows.Forms.DialogResult.OK
    End Sub

    Private Sub frmPreview_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
  
    End Sub
End Class